/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-03-25
 * Time: 18:04
 */
public class Demo3 {
 public static boolean flg =  true;
    public static void main(String[] args) throws InterruptedException {
       //   boolean flg =  true;
        Thread thread=new Thread(()->{
             while(flg){
                 System.out.println("hello thread");
                 try {
                     Thread.sleep(10000);
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
             }
        });
        thread.start();
        Thread.sleep(3000);
        flg=false;


    }
}
